FROM alibabadragonwell/dragonwell:21-standard-ga-alpine
# 切换目录
WORKDIR /usr/local
# 运行的端口
ENV SERVER_PORT 6011
# 声明端口映射
EXPOSE ${SERVER_PORT}
ARG JAVA_JAR=codegen-service.jar
ARG JAR_FILE=target/${JAVA_JAR}
ARG DEAULT_CE='prod'
ENV CE=$DEAULT_CE
COPY ${JAR_FILE} ${JAVA_JAR}
#ENTRYPOINT 不能被覆盖，CMD 会被覆盖命令
ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms128m -Xmx256m -Dfile.encoding=utf-8 -Duser.timezone=GMT+08 -Djava.security.egd=file:/dev/./urandom"

CMD sleep 60; java $JAVA_OPTS -jar codegen-service.jar --spring.profiles.active=$CE